<script type="text/javascript" src="js/homeFormValidator.js" /></script>
<div id="updateForm">
    <div id="homeDetails">
        <form name="updateHomeForm" class="regform" method="post" action="include/admin/updateHome.php" onsubmit="return validateUpdateHomeForm('updateHomeForm')">            
            <fieldset>
                <legend>General Property Details</legend>
                <ol>
                    <li>
                        <label for="homeID">Home ID</label>
                        <input id="homeID" name="homeID" type="text" value="<?php echo $row[$TABLE_HOME_HOMEID]?>" disabled="disabled" />
                    </li>
                    <li>
                        <label for="listingDate">Listed On</label>
                        <input id="listingDate" name="listingDate" type="text" value="<?php echo date("d/m/Y", $row[$TABLE_HOME_LISTINGDATE])?>" disabled="disabled" />                        
                    </li>
                    <li>
                        <label for="address">Address</label>
                        <input id="address" name="address" type="text" value="<?php echo $row[$TABLE_HOME_ADDRESS]?>" disabled="disabled" />
                    </li>
                    <li>
                        <label for="streetname">Street Name</label>
                        <input id="streetname" name="streetname" type="text" value="<?php echo $row[$TABLE_HOME_STREETNAME]?>" disabled="disabled" />
                    </li>
                    <li>
                        <label for="city">City<em>*</em></label>
                        <input id="city" name="city" type="text" value="<?php echo $row[$TABLE_HOME_CITY]?>" />
                    </li>
                    <li>
                        <label for="country">Country<em>*</em></label>
                        <input id="country" name="country" type="text" value="<?php echo $row[$TABLE_HOME_COUNTRY]?>" />
                    </li>                    
                </ol>
            </fieldset>
            <fieldset>
                <legend>Lot Details</legend>
                <ol>
                    <li>
                        <label for="district">District<em>*</em></label>
                        <input id="district" name="district" type="text" value="<?php echo $row[$TABLE_HOME_DISTRICT]?>" />
                    </li>
                    <li>
                        <label for="zone">Zone<em>*</em></label>
                        <input id="zone" name="zone" type="text" value="<?php echo $row[$TABLE_HOME_ZONE]?>" />
                    </li>
                    <li>
                        <label for="postalcode">Postal Code<em>*</em></label>
                        <input id="postalcode" name="postalcode" type="text" value="<?php echo $row[$TABLE_HOME_POSTALCODE]?>" />
                    </li>
                    <li>
                        <label for="lotsize">Lot Size (sq. ft.)<em>*</em></label>
                        <input id="lotsize" name="lotsize" type="text" value="<?php echo $row[$TABLE_HOME_LOTSIZE]?>" />
                    </li>
                    <li>
                        <label for="propertyType">Property Type<em>*</em></label>
                        <select id="propertyType" name="propertyType">                            
                            <option value="1" <?php echo ($row[$TABLE_HOME_PROPERTYTYPE] == 1 ? "selected" : "") ?>>Condo</option>
                            <option value="2" <?php echo ($row[$TABLE_HOME_PROPERTYTYPE] == 2 ? "selected" : "") ?>>Apartment</option>
                            <option value="3" <?php echo ($row[$TABLE_HOME_PROPERTYTYPE] == 3 ? "selected" : "") ?>>Single Family</option>
                            <option value="4" <?php echo ($row[$TABLE_HOME_PROPERTYTYPE] == 4 ? "selected" : "") ?>>Cottage</option>
                        </select>                        
                    </li>                    
                </ol>
            </fieldset>
            <fieldset>
                <legend>Specific Details</legend>
                <li>
                    <label for="yearbuilt">Year Built<em>*</em></label>
                    <input id="yearbuilt" name="yearbuilt" type="text" value="<?php echo $row[$TABLE_HOME_YEARBUILT]?>" minlength="4" maxlength="4"/>
                </li>
                <li>
                    <label for="heating">Has Heating<em>*</em></label>
                    <select id="heating" name="heating">                            
                        <option value="0" <?php echo ($row[$TABLE_HOME_HEATING] == 0 ? "selected" : "") ?>>No</option>
                        <option value="1" <?php echo ($row[$TABLE_HOME_HEATING] == 1 ? "selected" : "") ?>>Yes</option>
                    </select>                                        
                </li>
                <li>
                    <label for="cooling">Has Cooling<em>*</em></label>
                    <select id="cooling" name="cooling">                            
                        <option value="0" <?php echo ($row[$TABLE_HOME_COOLING] == 0 ? "selected" : "") ?>>No</option>
                        <option value="1" <?php echo ($row[$TABLE_HOME_COOLING] == 1 ? "selected" : "") ?>>Yes</option>
                    </select>                                        
                </li>
                <li>
                    <label for="parking">Has Parking<em>*</em></label>
                    <select id="parking" name="parking">                            
                        <option value="0" <?php echo ($row[$TABLE_HOME_PARKING] == 0 ? "selected" : "") ?>>No</option>
                        <option value="1" <?php echo ($row[$TABLE_HOME_PARKING] == 1 ? "selected" : "") ?>>Yes</option>
                    </select>                                        
                </li>
                <li>
                    <label for="garage">Has Garage<em>*</em></label>
                    <select id="garage" name="garage">                            
                        <option value="0" <?php echo ($row[$TABLE_HOME_GARAGE] == 0 ? "selected" : "") ?>>No</option>
                        <option value="1" <?php echo ($row[$TABLE_HOME_GARAGE] == 1 ? "selected" : "") ?>>Yes</option>
                    </select>                                        
                </li>
                <li>
                    <label for="driveway">Has Driveway<em>*</em></label>
                    <select id="driveway" name="driveway">                            
                        <option value="0" <?php echo ($row[$TABLE_HOME_DRIVEWAY] == 0 ? "selected" : "") ?>>No</option>
                        <option value="1" <?php echo ($row[$TABLE_HOME_DRIVEWAY] == 1 ? "selected" : "") ?>>Yes</option>
                    </select>                                        
                </li>
                <li>
                    <label for="neighborhood">Neighborhood<em>*</em></label>
                    <input id="neighborhood" name="neighborhood" type="text" value="<?php echo $row[$TABLE_HOME_NEIGHBOURHOOD]?>" />
                </li>
                <li>
                    <label for="recentImprovements">Recent Improvements</label>
                    <textarea id="recentImprovements" name="recentImprovements" rows="5" cols="30" wrap="physical">
                        <?php echo $row[$TABLE_HOME_IMPROVEMENTS]?>
                    </textarea>
                </li>
                <li>
                    <label for="evaluatedPrice">Evaluated Price ($)<em>*</em></label>
                    <input id="evaluatedPrice" name="evaluatedPrice" type="text" value="<?php echo $row[$TABLE_HOME_EVALUATION]?>" />
                </li>
                <li>
                    <label for="propertyTaxes">Property Taxes ($)<em>*</em></label>
                    <input id="propertyTaxes" name="propertyTaxes" type="text" value="<?php echo $row[$TABLE_HOME_TAXES]?>" />
                </li>
                <li>
                    <label for="utilityCost">Utility Cost ($)<em>*</em></label>
                    <input id="utilityCost" name="utilityCost" type="text" value="<?php echo $row[$TABLE_HOME_UTILITYCOST]?>" />
                </li>
                <li>
                    <label for="price">Asking Price ($)<em>*</em></label>
                    <input id="price" name="price" type="text" value="<?php echo $row[$TABLE_HOME_PRICE]?>" />
                </li>
                <li>
                    <label for="comments">Comments</label>
                    <textarea id="comments" name="comments" rows="5" cols="30" wrap="physical">
                        <?php echo $row[$TABLE_HOME_COMMENTS]?>
                    </textarea>
                </li>                
            </fieldset>
    </div>
        
            <input type="submit" name="Submit" value="Update">
        </form>
    
</div>